﻿@{
    ViewBag.Title = "添加";
    Layout = "../Shared/_Layout.cshtml";
}
@using mscook.mvc;
@model mscook.core.domain.Magazine

@section JavaScript
{
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.validate.unobtrusive.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/scripts/jquery.unobtrusive-ajax.js")"></script>
}
@Html.Partial("_MultiBtnModalLoder")
<div id="resourceTypeModal" class=" modal hide fade form-horizontal">
</div>
<div class="row-fluid sortable">
    <div class="box span12">
        <div class="box-header well">
            <h2></h2>

        </div>
        <div class="box-content">
            @using (Html.BeginForm("Add", "magazine", FormMethod.Post, new { enctype = "multipart/form-data", @class = "form-horizontal" }))
            {
                <fieldset>
                    <legend>期刊增加</legend>
                    <div class="control-group">
                        <label class="control-label">标题</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(magazine => magazine.Title, new { size = "16" })
                            </div>
                            @Html.ValidationMessageFor(magazine => magazine.Title)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">年份</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(magazine => magazine.Year, new { size = "16" })
                            </div>
                            @Html.ValidationMessageFor(magazine => magazine.Year)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">期数</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(magazine => magazine.Volume, new { size = "16" })
                            </div>
                            @Html.ValidationMessageFor(magazine => magazine.Volume)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">所需积分</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBoxFor(magazine => magazine.AbsBonus, new { size = "16" })
                            </div>
                            @Html.ValidationMessageFor(magazine => magazine.AbsBonus)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">类型</label>
                        <div class="controls">
                            <div class="input-prepend">
                                @Html.TextBox("MagazineTypeName", "", new { @readonly = "true" })
                                @Html.Hidden("MagazineTypeId")
                            </div>
                            <button id="resourceTypeModalBtn" type="button" class="btn btn-primary multimodalLoder" data-num="1" data-link-name="MagazineTypeName" data-link-id="MagazineTypeId" data-link-modal="resourceTypeModal" data-type="Magazine" data-url="/weblogin/resourcetype/MultiResourceTypeModal"><i class="icon-edit icon-white"></i></button>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">图片</label>
                        <div class="controls">
                            <div class="input-prepend" style="width: 400px">
                                <img id="preview" style="display: none; width: 100%" />
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">图片上传</label>
                        <div class="controls">
                            <div class="fileupload fileupload-new" data-provides="fileupload">
                                <span class="btn btn-file">
                                    <span class="fileupload-new">请选择图片</span>
                                    <span class="fileupload-exists">更改图片</span>
                                    <input name="related_content_image[0]" type="file" />
                                </span>
                                <span class="fileupload-preview"></span>
                                <a href="#" class="close fileupload-exists" data-dismiss="fileupload" style="float: none">×</a>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary">保存</button>
                        <button class="btn">Cancel</button>
                    </div>
                </fieldset>
            }
        </div>
    </div>
    <!--/span-->

</div>
